package com.shj.entity;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.List;

/**
 * @Description TODO 与zTree的节点对象有相同属性的菜单类
 * @Author songhuajian
 * @Date 2020/5/2 22:36
 **/
public class MenuTreeNode {
    private String id;
    private String pId;
    private String name;
    @JSONField(serialize=false)
    private List<MenuTreeNode> children;
    private boolean checked;
    private int level;
    private String url;
    private boolean open;

    public MenuTreeNode(SysMenu sysMenu){
        this.id =sysMenu.getMenuId();
        this.name =sysMenu.getMenuName();
        this.pId =sysMenu.getMenuPid();
        this.open=true;
        this.level =sysMenu.getLevel();
        this.url =sysMenu.getUrl();
    }

    public MenuTreeNode(String id, String name, List<MenuTreeNode> children) {
        super();
        this.id = id;
        this.name = name;
        this.children = children;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getpId() {
        return pId;
    }

    public void setpId(String pId) {
        this.pId = pId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<MenuTreeNode> getChildren() {
        return children;
    }

    public void setChildren(List<MenuTreeNode> children) {
        this.children = children;
    }

    public boolean isChecked() {
        return checked;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public boolean isOpen() {
        return open;
    }

    public void setOpen(boolean open) {
        this.open = open;
    }
}
